package com.sora.controller.api;

import com.sora.model.param.LoginParam;
import com.sora.model.vo.Test;
import com.sora.model.vo.UserVO;
import com.sora.service.UserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import javax.validation.Valid;

@Api(value = "登录接口")
@RestController
@RequestMapping("api")
public class LoginController {

    @Resource
    UserService userService;

    @ApiOperation(value = "用户通过账号邮箱登录接口--sora")
    @PostMapping("/login")
    public UserVO login(@RequestBody @Valid LoginParam param) {
        return userService.login(param);
    }

    @ApiOperation(value = "测试1--sora")
    @GetMapping("/test")
    public String test() {
        return userService.test();
    }

//    @ApiOperation(value = "用户退出登录--sora")
//    @PostMapping("/logout")
//    public String logout(String username) {
//        return userService.logout(username);
//    }
}
